'use strict';

goog.provide('Blockly.Arduino.display');

goog.require('Blockly.Arduino');


Blockly.Arduino.forBlock['oled_init'] = function () {
    var ROTATION = this.getFieldValue('ROTATION');
    var ADDRESS = '0x3C';
    //var board_type ="ESP8266";
    Blockly.Arduino.definitions_['include_U8g2lib'] = '#include <U8g2lib.h>';
    Blockly.Arduino.definitions_['include_Wire'] = '#include <Wire.h>';
    Blockly.Arduino.definitions_['var_declare_U8G2u8g2'] = 'U8G2_SSD1306_128X64_NONAME_F_HW_I2C ' + 'u8g2(' + ROTATION + ', U8X8_PIN_NONE);';
    Blockly.Arduino.setups_["setup_u8g2u8g2"] =  'u8g2.setI2CAddress(' + ADDRESS + '*2);\n'
        + '  '+ 'u8g2.begin();';
    var code = '';
    return code;
};